#include "SelfChangedEvent.h"

namespace Impp
{

DEFINE_EVENT_TYPE(EVT_SELF_CHANGED) 

SelfChangedEvent::SelfChangedEvent(Buddy* self, SelfChangedEventType changeType, wxEventType eventType , int id) :
	wxNotifyEvent(eventType,id),
	self(self),
	changeType(changeType)
{
}

SelfChangedEvent::~SelfChangedEvent()
{
}

Buddy* SelfChangedEvent::getSelf(){
	return self;
}

wxString SelfChangedEvent::getOldCustomName(){
	if(changeType == SELF_CHANGED_CUSTOMNAME){
		return oldName;
	}
	return wxEmptyString;
}
wxString SelfChangedEvent::getNewCustomName(){
	if(changeType == SELF_CHANGED_CUSTOMNAME){
		return newName;
	}
	return wxEmptyString;
}
wxString SelfChangedEvent::getOldScreenName(){
	if(changeType == SELF_CHANGED_SCREENNAME){
		return oldName;
	}
	return wxEmptyString;
}
wxString SelfChangedEvent::getNewScreenName(){
	if(changeType == SELF_CHANGED_SCREENNAME){
		return newName;
	}
	return wxEmptyString;
}

wxEvent* SelfChangedEvent::Clone() const {
	return new SelfChangedEvent(*this);
}

void SelfChangedEvent::setOldCustomName(const wxString & oldCustomName){
	this->oldName=oldCustomName;
}

void SelfChangedEvent::setNewCustomName(const wxString & newCustomName){
	this->newName=newCustomName;
}

void SelfChangedEvent::setOldScreenName(const wxString & oldScreenName){
	this->oldName=oldScreenName;
}

void SelfChangedEvent::setNewScreenName(const wxString & newScreenName){
	this->newName=newScreenName;
}

SelfChangedEventType SelfChangedEvent::getChangeType(){
	return changeType;
}

}
